package de.koller.worlders.engine.tiles.light;

import java.util.Iterator;

public class NeighborIterator implements Iterator<int[]> {
	private int index = 0;

	@Override
	public boolean hasNext() {
		return index < 4;
	}

	@Override
	public int[] next() {
		index++;
		switch ( index ) {
			case 1:
				return new int[ ] { 0, -1 };
			case 2:
				return new int[ ] { 1, 0 };
			case 3:
				return new int[ ] { 0, 1 };
			case 4:
				return new int[ ] { -1, 0 };
		}
		throw new IndexOutOfBoundsException();
	}

	@Override
	public void remove() {
		throw new UnsupportedOperationException( "Not supported yet." );
	}
	
}
